<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-nested" prefix="nested" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ page contentType="text/html; charset=utf-8"  import="com.leexuan.ordersystem.beans.*" import="com.leexuan.ordersystem.*"  import="java.util.*"%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">

<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<LINK href="css/admincp.css" type=text/css rel=stylesheet>
<html:base/></HEAD>
<BODY topMargin=10>
<TABLE cellSpacing=6 cellPadding=2 width="100%" border=0>
  <TBODY>
  <TR>
    <TD>
      <TABLE class=guide cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR>
          <TD>发票管理&nbsp;>>&nbsp;订单开票</TD></TR></TBODY></TABLE><BR>
      <TABLE class=tableborder cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR class=header>
          <TD colSpan=2>订单开票</TD></TR>
          
<%

Order od = (Order)session.getAttribute("order");
Customer cs = (Customer)session.getAttribute("customer");
boolean hasInvoice = (String)session.getAttribute("hasInvoice")=="yes"?true:false;

%>          
        <TR>
          <TD class=altbg1 width="20%">订单编号：</TD>
          <TD class=altbg2 align=right>#<%=od.getOid()%></TD></TR>

        <TR>
          <TD class=altbg1>客户名称：</TD>
          <TD class=altbg2 align=right width="50%">
          <%=cs.getName()%>
          </TD>

          </TR>
        <TR>
          <TD class=altbg1>客户开户银行：</TD>
          <TD class=altbg2 align=right>
          <%=cs.getBank()%></TD>
          </TR>
        <TR>
          <TD class=altbg1>客户银行帐号：</TD>
          <TD class=altbg2 align=right>
          <%=cs.getAccount()%></TD>
          </TR>

        <TR>
          <TD class=altbg1 width="30%">开票日期：</TD>
          <TD class=altbg2 align=right>

<script type="text/javascript">

var myDate = new Date(); 

document.write( myDate.getFullYear()+"-"+(myDate.getMonth()+1)+"-"+myDate.getDate());

</script> 
</TD></TR>
            
        <TR>
          <TD class=altbg1>发票金额：</TD>
          <TD class=altbg2 align=right><%=od.getSum()%> 元</TD></TR>
<%
if(hasInvoice){
%>    
<TR><TD colSpan=2><center><font color="red">提示：订单已经开发票！</font></center></TD></TR>                                                     
 <%
}else{
%>  
<TR><TD colSpan=2><center><font color="red">提示：点击按钮，确认开出发票！</font></center></TD></TR> 

<%} %>


     </TBODY></TABLE><BR>


<%
session.removeAttribute("order");
session.removeAttribute("customer");
session.removeAttribute("hasInvoice");
%>
      
      
<%
if(hasInvoice){
%>
<CENTER><INPUT class=button type=button value="返回订单列表" onclick="window.location.href='listOrder.do';">  <INPUT class=button type=button value="发票一览表" onclick="window.location.href='listInvoice.do';"></CENTER>
<%
}else{
%> 
<CENTER><INPUT class=button type=button value="确认开票" onclick="window.location.href='addInvoice2.do?oid=<%=od.getOid()%>';"></CENTER>

<%
}
%>  

      
      	</TD></TR></TBODY></TABLE>

<%@include file= "./footer.jsp"%>
